reading-notes

Heroku

What is is used for?

Node.js For Beginners. Deploy Your Blog to Heroku

To see how servers work from within, we can build a simple web server by ourselves.

We use Node.js as a server part technology for that task.

First of all, we need to create a JavaScript file. Let’s name it server.js: var http = require(“http”);

http.createServer(function(request, response) { response.writeHead(200, {“Content-Type”: “text/plain”}); response.write(“It’s alive!”); response.end(); }).listen(3000); It’s a simple server and we can make sure it’s running by typing (node server.js) in your terminal.